package test;
import static org.junit.Assert.*; 

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.PostfixEvaluator;

public class JohnCostantinoPETest 
{
	@Before
	public void setUp() throws Exception
	{	
		
	}
	
	@After
	public void tearDown() throws Exception
	{
		
	}
	
	@Test
	public void evalTesterOne() throws Exception
	{
		int answer = PostfixEvaluator.eval("1 2 3 * +");
		assertTrue(answer == 7);
	}
	
	@Test
	public void evalTesterTwo() throws Exception
	{
		int answer = PostfixEvaluator.eval("1 2 + 4 2 ^ * 6 /");
		assertTrue(answer == 8);
	}
	@Test
	public void evalTesterThree() throws Exception
	{
		int answer = PostfixEvaluator.eval("2 3 * 6 2 / +");
		assertTrue(answer == 9);
	}
	@Test
	public void evalTesterFour() throws Exception
	{
		int answer = PostfixEvaluator.eval("6 2 ^ 2 * 7 +");
		assertTrue(answer == 79);
	}
	@Test
	public void evalTesterFive() throws Exception
	{
		int answer = PostfixEvaluator.eval("8 2 / 7 + 2 * 4 -");
		assertTrue(answer == 18);
	}
}
